﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Things.Common;

namespace Things.ThingsWeb.Goods
{
    public partial class Goods : System.Web.UI.Page
    {
        protected Guid GoodsPriceID
        {
            get
            {
                Guid temp = Guid.Empty;
                try
                {
                    if (Request.QueryString["id"] != null)
                    {
                        bool flag = Guid.TryParse(Request.QueryString["id"].Trim(), out temp);
                        if (flag == false)
                        {
                            temp = Guid.Empty;
                        }
                    }
                }
                catch
                {
                    temp = Guid.Empty; 
                }
                return temp;
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                
                BindData();
            }
        }

        protected void BindData()
        {
            Things.BLL.GoodsPrice gpBLL = new BLL.GoodsPrice();
            Things.Model.GoodsPrice gpModel = gpBLL.GetModel(GoodsPriceID);
            if (gpModel != null)
            {
                Things.BLL.Goods gBLL = new BLL.Goods();
                Things.Model.Goods gModel = gBLL.GetModel(gpModel.GoodsID);
                if (gModel != null)
                {
                    GoodsRelationInformation1.GoodsID = gModel.GoodsID;                    
                }

                GoodsRelationInformation1.GoodsPriceID = GoodsPriceID;
            }
        }

        
    }
}